package com.qf.controller;

import com.qf.pojo.TBteacher;
import com.qf.service.TeacherService;
import com.qf.service.impl.TeacherServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/del")
public class DelTecherController extends HttpServlet {


    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //1.声明Service
        TeacherService teacherService = new TeacherServiceImpl();
        //获取删除的id
        String id = req.getParameter("id");
        //2.执行方法
        String msg = teacherService.del(Integer.valueOf(id));
        //返回 --异步请求使用Resp进行返回
        resp.getWriter().write(msg);
    }


}
